package com.micro.modual.extension;

import com.micro.common.MicroConstant;
import com.micro.common.biz.GeneratorCodeUtil;
import com.micro.common.util.SnowFlakeUtil;
import com.micro.modual.entity.UserQueryHistory;
import com.micro.modual.model.bo.userqueryhistory.UserQueryHistoryBO;

/**
 * <h1>用户搜索历史表 延展类</h1>
 * @author LevelCoder
 * @version V1.0.0
 * @email LevelCoder@126.com
 * @date 2020-08-04 00:23:26
 */
public class UserQueryHistoryExtension {

    /**
     * <h2>转换: 用户搜索历史表 新增</h2>
     * @param userQueryHistoryBO {@link UserQueryHistoryBO} 用户搜索历史表 新增/修改 请求对象
     * @return {@link UserQueryHistory} 用户搜索历史表
     */
    public static UserQueryHistory converAddUserQueryHistory(UserQueryHistoryBO userQueryHistoryBO) {
        UserQueryHistory userQueryHistory = new UserQueryHistory();
        userQueryHistory.setId(SnowFlakeUtil.getId());
                                                            userQueryHistory.setUserCode(userQueryHistoryBO.getUserCode());
                                                    userQueryHistory.setQueryKeyword(userQueryHistoryBO.getQueryKeyword());
                                                    userQueryHistory.setCreateTime(userQueryHistoryBO.getCreateTime());
                                                    userQueryHistory.setUpdateTime(userQueryHistoryBO.getUpdateTime());
                            return userQueryHistory;
    }

    /**
     * <h2>转换: 用户搜索历史表 修改</h2>
     * @param userQueryHistoryBO {@link UserQueryHistoryBO} 用户搜索历史表 新增/修改 请求对象
     * @return {@link UserQueryHistory} 用户搜索历史表
     */
    public static UserQueryHistory converEditUserQueryHistory(UserQueryHistoryBO userQueryHistoryBO) {
        UserQueryHistory userQueryHistory = new UserQueryHistory();
        userQueryHistory.setId(userQueryHistoryBO.getId());
                                                        userQueryHistory.setUserCode(userQueryHistoryBO.getUserCode());
                                                userQueryHistory.setQueryKeyword(userQueryHistoryBO.getQueryKeyword());
                                                userQueryHistory.setCreateTime(userQueryHistoryBO.getCreateTime());
                                                userQueryHistory.setUpdateTime(userQueryHistoryBO.getUpdateTime());
                            return userQueryHistory;
    }
}
